using System.Collections.Generic;
using System;
using Commons.Models.Settings.Serialization;

namespace Commons.Models.Capabilities
{
	[Serializable]
	public class Taggable : ITaggable
	{
		public string Name { get { return "Taggable"; } }
		public HashSet<string> Tags { get; protected set; }

		public Taggable()
		{
			this.Tags = new SerializableHashSet<string>();
		}

		public Taggable(HashSet<string> tags)
		{
			this.Tags = new SerializableHashSet<string>(tags);
		}

		public bool HasTag(string tag)
		{
			return Tags.Contains(tag.Trim().ToLower());
		}

		public void AddTag(string tag)
		{
			Tags.Add(tag.Trim().ToLower());
		}
	}
}

